import { Module } from 'vuex'
import { GlobalDataProps } from "./index";
import { PageData } from "./editor";

export type TemplateProps = Required<Omit<PageData, 'props'|'setting'>>
export interface TemplatesProps{
  data: TemplateProps;
  // data:[],
  totalTemplates: number[];
  // works:TemplateProps;
  totalWorks: number;
}

const templates: Module<TemplatesProps, GlobalDataProps> = {
  getters:{
    getTemplateById: (state, getters, rootState) => (id: number) => {
      return '1'
      // return state.data.find(t => t.id === id)
    }
  }

}

export default  templates;